[ Intro ]   [ Lesson1 ]   [ Lesson2 ]   [ Lesson3 ]   [ Lesson4 ]   [ Lesson5 ]   [ Lesson6 ]   [ Lesson7 ]   [ Lesson8 ]

Prerequisites to Scripting for TA

There are a few vital files you'll also need as well as this guide to script TA units. I'm assuming you already edit units and so have a decent HPI Viewer and Packer, as well as an understanding of model object trees in 3DOBuilder. When you have these, you'll also need a TA script compiler. I highly recommend Scriptor, by KhalvKalash but other scripting programs include:

MarcoSoft LazyScriptor - the owner admits this sucks, maybe useful for generating a quick walk script.
Brain - used by a few, most notably Nik at TADesigners.com/Estrella/S.T.A.R.
Cobbler - has a few code-checking flaws, so will allow many errors through. Partner program UnCobble is in French.
Servo - not used, it sucks.

Scriptor is recognized by the majority of the top scripters to be the best. However, some have encountered problems with version 1.0 (Release Candidate) due to TA:K compatibility errors (mainly with On/Off states). It is thus strongly suggested you use either the .h include files from version 0.74, or those from totala1.hpi/scripts/. With this fix you can use the latest interface options, or just use version 0.74 to avoid the bother (scroll down for the link).
Except for this, it has many more features than other compilers, and more than are needed for TA. Version 0.74 will definitely suffice and is what I have used for over a year. This guide is also written around it.

The language used in TA scripting is specific to this game engine only, but apparently like C/C++, and no prior knowledge of real programming is required (understanding of simple actions is guided and then assumed). Also, this guide will start with the basics, using as little as possible at first, and build up from there.

If you would like to download this guide for offline browsing, here's a link to: Proud's Scripting Guide v0.8.zip. This is highly reccomended, as you will need the example files to follow the guide properly.

For your easy, here's a link to: Scriptor v1.0
Khalv's TA Apps hosts Scriptor 1.0(RC) and it's source.

Contents of this guide:

Lesson1
Settings: Includes and Constants
Piece ;
Static-var ;
Create()
Sweetspot(piecenum)

Lesson2
Basic damage animations
SmokeUnit.h
Killed(severity, corpsetype)
More about includes

Lesson3
Weapons
Signal & Set-Signal-Mask
AimFromPrimary(piecenum)
AimPrimary(heading, pitch)
QueryPrimary(piecenum)
FirePrimary()
Feuer frei!

Lesson4
More advanced weapon actions
RestoreAfterDelay() & restore_delay
Alternating firepoints
Disable-able weapons
Fire arcs

Lesson5
Animation and activation
StateChg.h
Activate() & Deactivate()
How it all works
Cache and Shade
Metal Extracting and Wind animations
SetSpeed(the_speed)
SetSpeed(fanspeed)
SetDirection(dir)

Lesson6
Nanolathing
Yardmaps

Lesson7
Transports

Lesson8
Explodeparts.h

© Proud like a god (and a little Storm)